echo "deleting all files.."
rm -rf ./application
rm -rf ./system
rm -rf ./init
rm -rf ./static
rm -f ./*.php

echo "extracting files.."
tar xzfp dbdbdib.tar.gz
echo "Done!"
echo "Initializing mysql db for dbdbdib.."
echo "Dropping all tables.."
mysql -udbdbdib -pdlaudqkr -D dbdbdib -e "show tables" | grep -v Tables_in | grep -v "+" | gawk '{print "drop table " $1 ";"}' | mysql -udbdbdib -pdlaudqkr -D dbdbdib
echo "Done!"
echo "Creating tables with initial data..."
mysql -udbdbdib -pdlaudqkr -D dbdbdib < init/init.sql
echo "Deleting archive file..";
rm -f ./*.gz
echo "Deleting myself...";
rm -f ./install.sh
echo "All done!"
